package com.example.hehecat.yuejian1.ui.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.hehecat.yuejian1.R;
import com.example.hehecat.yuejian1.mvp.model.api.Api;
import com.example.hehecat.yuejian1.mvp.model.bean.MasterLessonBean;
import com.squareup.picasso.Picasso;

public class ActivityLessonListAdapter extends BaseQuickAdapter<MasterLessonBean,BaseViewHolder> {
    Context context;
    public ActivityLessonListAdapter(int layoutResId, Context context) {
        super(layoutResId);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, MasterLessonBean item) {
        helper.setText(R.id.item_name,item.getLessonname())
                .setText(R.id.item_intro,"等级"+String.valueOf(item.getIntro()))
                .setText(R.id.item_date,"价格"+item.getPrice());

        Picasso.with(context).load(Api.IMG_URL+item.getPic()).into((ImageView) helper.getView(R.id.master_pic));
    }
}
